package com.soulkun.smarthome.ui.main.personal.adapter

import android.content.Context
import android.view.View
import androidx.databinding.ObservableArrayList
import androidx.databinding.ViewDataBinding
import com.soulkun.smarthome.R
import com.soulkun.smarthome.databinding.AppRecycleItemMainPersonalFamilyLocationSearchListBinding
import com.soulkun.smarthome.logic.model.AddressModel
import com.soulkun.smarthome.logic.vo.RoomSelectVO
import soulkun.library.mvvm.adapter.BaseDataBindingRecyclerViewAdapter

class AppMainPersonalFamilyLocationSearchListAdapter(
    context: Context,
    dataList: ObservableArrayList<AddressModel>,
    private val onClickListener: (ViewDataBinding) -> View.OnClickListener
) :
    BaseDataBindingRecyclerViewAdapter<AddressModel>(context, dataList) {

    override fun getContentLayoutResId(): Int {
        return R.layout.app_recycle_item_main_personal_family_location_search_list
    }

    override fun setContentViewHolderCreateListener(binding: ViewDataBinding) {
        (binding as AppRecycleItemMainPersonalFamilyLocationSearchListBinding).onClickListener =
            onClickListener(binding)
    }

    override fun setContentViewHolderBindListener(binding: ViewDataBinding, dataPosition: Int) {
        (binding as AppRecycleItemMainPersonalFamilyLocationSearchListBinding).addressModel =
            dataList[dataPosition]
    }

}